package com.guigu.dealservice.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.guigu.equipmentservice.entity.DetectionReport;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;


public class Equipment implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "equipment_id", type = IdType.AUTO)
    private Long equipmentId;
    private Long userId;
    private Integer typeId;
    private String brand;
    private String model;
    private Integer year;
    private Integer hour;
    private BigDecimal price;
    private BigDecimal verticalHeight;
    private Integer chassisAxle;
    private String outriggerType;
    private String emissionStandard;
    private String location;
    private String contactName;
    private String contactPhone;
    private String description;
    private Integer status;
    private Integer isDetected;
    private Long detectionReportId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime releaseTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime auditTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private List<String> images;

    @TableField(exist = false)
    private EquipmentType equipmentType;

    @TableField(exist = false)
    private String typeName;

    @TableField(exist = false)
    private String imageUrl;

    @TableField(exist = false)
    private User user;

    @TableField(exist = false)
    private List<EquipmentImage> equipmentImages;

    @TableField(exist = false)
    private String videoUrl;

    @TableField(exist = false)
    private String typeDesc;


    // Getter and Setter methods (修正后的版本)
    public Long getEquipmentId() {
        return equipmentId;
    }

    public void setEquipmentId(Long equipmentId) {
        this.equipmentId = equipmentId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getTypeId() {
        return typeId;
    }

    // 修正：正确设置 typeId
    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    // 删除错误的 setEquipmentType(Integer) 方法
    // public void setEquipmentType(Integer equipmentType) {
    //     this.typeId = typeId;  // 这个方法有问题，删除它
    // }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public Integer getHour() {
        return hour;
    }

    public void setHour(Integer hour) {
        this.hour = hour;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getVerticalHeight() {
        return verticalHeight;
    }

    public void setVerticalHeight(BigDecimal verticalHeight) {
        this.verticalHeight = verticalHeight;
    }

    public Integer getChassisAxle() {
        return chassisAxle;
    }

    public void setChassisAxle(Integer chassisAxle) {
        this.chassisAxle = chassisAxle;
    }

    public String getOutriggerType() {
        return outriggerType;
    }

    public void setOutriggerType(String outriggerType) {
        this.outriggerType = outriggerType;
    }

    public String getEmissionStandard() {
        return emissionStandard;
    }

    public void setEmissionStandard(String emissionStandard) {
        this.emissionStandard = emissionStandard;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getIsDetected() {
        return isDetected;
    }

    public void setIsDetected(Integer isDetected) {
        this.isDetected = isDetected;
    }

    public Long getDetectionReportId() {
        return detectionReportId;
    }

    public void setDetectionReportId(Long detectionReportId) {
        this.detectionReportId = detectionReportId;
    }

    public LocalDateTime getReleaseTime() {
        return releaseTime;
    }

    public void setReleaseTime(LocalDateTime releaseTime) {
        this.releaseTime = releaseTime;
    }

    public LocalDateTime getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(LocalDateTime auditTime) {
        this.auditTime = auditTime;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public List<String> getImages() {
        return images;
    }

    public void setImages(List<String> images) {
        this.images = images;
    }

    public EquipmentType getEquipmentType() {
        return equipmentType;
    }

    // 保留正确的 setEquipmentType 方法（用于 EquipmentType 对象）
    public void setEquipmentType(EquipmentType equipmentType) {
        this.equipmentType = equipmentType;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<EquipmentImage> getEquipmentImages() {
        return equipmentImages;
    }

    public void setEquipmentImages(List<EquipmentImage> equipmentImages) {
        this.equipmentImages = equipmentImages;
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }

    public String getTypeDesc() {
        return typeDesc;
    }

    public void setTypeDesc(String typeDesc) {
        this.typeDesc = typeDesc;
    }

    @Override
    public String toString() {
        return "Equipment{" +
                "equipmentId=" + equipmentId +
                ", userId=" + userId +
                ", typeId=" + typeId +
                ", brand='" + brand + '\'' +
                ", model='" + model + '\'' +
                ", year=" + year +
                ", hour=" + hour +
                ", price=" + price +
                ", verticalHeight=" + verticalHeight +
                ", chassisAxle=" + chassisAxle +
                ", outriggerType='" + outriggerType + '\'' +
                ", emissionStandard='" + emissionStandard + '\'' +
                ", location='" + location + '\'' +
                ", contactName='" + contactName + '\'' +
                ", contactPhone='" + contactPhone + '\'' +
                ", description='" + description + '\'' +
                ", status=" + status +
                ", isDetected=" + isDetected +
                ", detectionReportId=" + detectionReportId +
                ", releaseTime=" + releaseTime +
                ", auditTime=" + auditTime +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", typeName='" + typeName + '\'' +
                ", imageUrl='" + imageUrl + '\'' +
                ", equipmentType=" + equipmentType +
                ", videoUrl='" + videoUrl + '\'' +
                ", user=" + user +
                ", equipmentImages=" + equipmentImages +
                ", typeDesc='" + typeDesc + '\''+
                '}';
    }
}